<form class="layui-form">
<div class='mendsign'>
<div class="mend_top">

	<span>您当前总退款率为7.75%</span>
<br>
当前将退款比例降至0%，您需要使用消减卡<strong class="green">1</strong>张<p>您当前拥有消减卡数量：<strong style=color:#0b9a00>0</strong> 张 （<a href="/jifen/11" style="text-decoration:underline" target="_blank">兑换</a>）</p>
	<input type="hidden" name="good" value="backpp">
			</div>
<font  color="#999999">店铺退款率处罚说明：<br>当总退款率达到（<b class="red">30%</b>）及以上时，系统自动予以封号封店处罚！<br>当总退款率达到（<b class="orange">20%</b>）及以上时，商品展示页面出现风险提示！</font>
</div>
</form>
<script language="javascript">
$('.j-number a').on('click',function(){ 
		var targetInput = $(this).parent().find('.j-number-input'),
			goods_max = parseInt(targetInput.attr('maxval')),type=$(this).attr('class'),
			input = parseInt(targetInput.val()) + (type=='up'?1:-1);
		if(input <0 || goods_max == 0){
			targetInput.val(0);
		}else if(input <=0 && goods_max != 0){
			targetInput.val(1);
		}else if(goods_max <0){
			targetInput.val(input<9999?input:9999);
		}else if(input > goods_max ) {
		    layer.alert('用卡数量不能超过可用上限！',{icon:0});
			targetInput.val(goods_max);
		} else{
			targetInput.val(input);
		}
});
	
$('.j-number-input').on('blur', function() {
var goods_max = parseInt($(this).attr('maxval')),
				goods_cur = parseInt($(this).val());
				goods_cur = goods_cur > 0 ? goods_cur : 1;

			if(goods_cur <0 || goods_max == 0){
				$(this).val(0);
			}else if(goods_cur <=0 && goods_max != 0){
				$(this).val(1);
			}else if(goods_max <0){
				$(this).val(goods_cur<9999?goods_cur:9999);
			}else if(goods_cur > goods_max ) {
				layer.alert('用卡数量不能超过可用上限！',{icon:0});
				$(this).val(goods_max);
			} else{
				$(this).val(goods_cur);
			}
});

 layui.use('form', function(){
  var form = layui.form();
	form.on('submit(backpp)', function(data) {
		var use_card=parseInt($('.j-number-input').val());
		layer.confirm('您确定使用<b class="blue">'+use_card+'</b>张【退款率消减卡】吗', {icon: 3, title:'提示'}, function(index){
			dform('action=backpp&use_card='+use_card,'expost');
			layer.close(index);
		});
		return false;
	});
 });
</script>